first principles differentiation sinx